
<!DOCTYPE html>
<html>

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no" />
    <meta content="yes" name="apple-mobile-web-app-capable" />
    <meta content="black" name="apple-mobile-web-app-status-bar-style">
    <meta content="telephone=no" name="format-detection" />
    <meta content="emai=no" name="format-detection" />
    <link rel="stylesheet" type="text/css" href="<?php echo STATIC_HOST;?>shared/css/shared.css" />
    <link rel="stylesheet" type="text/css" href="<?php echo STATIC_HOST;?>gene/css/common.css" />
    <link rel="stylesheet" type="text/css" href="<?php echo STATIC_HOST;?>gene/css/orders.css" />
    <script type="text/javascript" src="<?php echo STATIC_HOST;?>shared/js/zepto-1.1.6.js"></script>
    <script async="" charset="UTF-8" src="//static.meiqia.com/dist/meiqia.js?v=20"></script>
    <title>订单详细</title>
    <script type="text/javascript">
        function Cancel(order_id){
            var r=confirm("是否确认取消订单!");
            if(r) {
                $.ajax({
                    url: "/sale/order/ajaxcancel",
                    type: "post",
                    cache: false,
                    dataType: 'json',
                    data: {order_id: order_id},
                    success: function (msg) {
                        if (msg.error == 1) {
                            zsmm.Toast.New("请重试！");
                        } else {
                            window.location.reload();
                            zsmm.Toast.New(msg.msg);
                        }

                    },

                    error: function () {
                        zsmm.Toast.New("请重试！");
                    }
                });
            }
        }
    </script>
    <script type='text/javascript'>
        (function(m, ei, q, i, a, j, s) {
            m[a] = m[a] || function() {
                    (m[a].a = m[a].a || []).push(arguments)
                };
            j = ei.createElement(q),
                s = ei.getElementsByTagName(q)[0];
            j.async = true;
            j.charset = 'UTF-8';
            j.src = i + '?v=' + new Date().getUTCDate();
            s.parentNode.insertBefore(j, s);
        })(window, document, 'script', '//static.meiqia.com/dist/meiqia.js', '_MEIQIA');
        _MEIQIA('entId', '20405');
        _MEIQIA('withoutBtn');
        _MEIQIA('init');
    </script>
    <script>
        Zepto(function ($) {
            function onBridgeReady() {
                WeixinJSBridge.call('hideOptionMenu');
            }

            if (typeof WeixinJSBridge == "undefined") {
                if (document.addEventListener) {
                    document.addEventListener('WeixinJSBridgeReady', onBridgeReady, false);
                } else if (document.attachEvent) {
                    document.attachEvent('WeixinJSBridgeReady', onBridgeReady);
                    document.attachEvent('onWeixinJSBridgeReady', onBridgeReady);
                }
            } else {
                onBridgeReady();
            }
        });
    </script>
</head>

<body>
<div class="wrapper">
    <div class="order-detail s<?php echo $order_status ?>">
        <header><?php echo $order_status_des ?></header>
        <div class="user-info">
            <p class="clear">
                <span class="s-right"><?php echo $telephone ?></span>
						<span>收货人：<?php echo $addressee ?><span>
            </p>
            <p>收货地址：<?php echo $province.$city.$district.$address ?></p>
        </div>
        <div class="order-info">
            <p>订单号：<?php echo $order_no ?></p>
            <div class="flex-wrapper flex-align-center">
                <p>
								<span class="avatar">
								<?php echo $product_img ?>
							</span>
                </p>
                <div class="flex-1">
                    <p class="title clear"><span class="s-right">&yen; <?php echo $product_price ?></span><?php echo $product_name ?></p>
                    <p class="price">x <?php echo $product_num ?></p>
                </div>
            </div>
            <div class="order-total s4">
                共<?php echo $product_num ?>件商品，金额<span class="special">&yen; <?php echo $order_amount ?></span>
            </div>
        </div>
        <div class="service-link">
            <ul class="flex-wrapper flex-align-center">
                <li class="flex-1">
                    <a href="javascript:void(0)" onclick="_MEIQIA('showPanel')"><img src="<?php echo STATIC_HOST;?>gene/img/d_online_o.png"></a>
                </li>
                <li class="flex-1">
                    <a href="tel:4008210418"><img src="<?php echo STATIC_HOST;?>gene/img/d_phone_o.png"></a>
                </li>
            </ul>
        </div>
        <div class="order-info">
            <p>订单编号：<?php echo $order_no ?></p>
            <p>创建时间：<?php echo date('Y-m-d H:i:s', $create_time) ?></p>
            <?php if($order_status == 5 ){ ?>
                <p>取消时间：<?php echo date('Y-m-d H:i:s', $cancellation_time) ?></p>
            <?php }elseif($order_status == 2 ){ ?>
                <p>付款时间：<?php echo date('Y-m-d H:i:s', $pay_time) ?></p>
            <?php }elseif($order_status == 3 ){ ?>
                <p>付款时间：<?php echo date('Y-m-d H:i:s', $pay_time) ?></p>
                <p>发货时间：<?php echo date('Y-m-d H:i:s', $send_time) ?></p>
            <?php }elseif($order_status == 4 ){ ?>
                <p>付款时间：<?php echo date('Y-m-d H:i:s', $pay_time) ?></p>
                <p>发货时间：<?php echo date('Y-m-d H:i:s', $send_time) ?></p>
            <?php } ?>


        </div>
        <div class="order-action" id="order_id_<?php echo $v['order_id'] ?>" >
            <?php if($order_status == 1 ){ ?>
                <a class="btn btn-cancel" href="javascript:void(0);" id="<?php echo $border_id ?>" onclick=Cancel(<?php echo $border_id ?>)>取消订单</a>
                <a class="btn" href="/wxpay/success?id=<?php echo $border_id ?>">付款</a>
            <?php }elseif($order_status == 3 || $order_status == 4 ){ ?>
               <?php if($category_id != 3){?>
                <?php if($sample_status_0 == 1 && $sample_status_1 == 1 ){ ?>
                    <a class="btn" href="/bind/sample/index?id=<?php echo $product_id ?>" >样本绑定</a>
                    <a class="btn" href="/sale/check/index?id=<?php echo $product_id ?>">样本查看</a>
                <?php }elseif($sample_status_0 == 1 ){ ?>
                    <a class="btn" href="/bind/sample/index?id=<?php echo $product_id ?>" >样本绑定</a>
                <?php }elseif($sample_status_1 == 1 ){ ?>
                    <a class="btn" href="/sale/check/index?id=<?php echo $product_id ?>">样本查看</a>
                <?php } ?>
              <?php } ?>
            <?php } ?>
        </div>
        <!--<div class="order-action">
            <a class="btn btn-cancel" href="#">取消订单</a>
            <a class="btn" href="#">付款</a>
        </div>
        <div class="order-action">
                <a class="btn" href="#">样本绑定</a>
                <a class="btn" href="#">样本查看</a>
            </div>-->
    </div>
    <script type="text/javascript" src="<?php echo STATIC_HOST;?>shared/js/shared.js"></script>
    <script type="text/javascript" src="<?php echo STATIC_HOST;?>gene/js/order.js"></script>
</body>

</html>